package com.cpecc.model.system;

import java.io.Serializable;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.LazyCollection;
import org.hibernate.annotations.LazyCollectionOption;

@Entity
@Table(name = "SYS_ROLE")
public class Role implements Serializable {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 4777457684997421047L;

	@Id
	@GeneratedValue(generator = "system-uuid")
	@GenericGenerator(name = "system-uuid", strategy = "uuid")
	@Column(length = 32)
	private String id;
	
	@Column(length = 50)
	private String roleName;
	
	@Column(length = 100)
	private String description;
	
	@Column
	private int No;
	
	@Column
	private int roleLX;	
	
	@OneToMany(mappedBy="role")
	@LazyCollection(LazyCollectionOption.EXTRA)
	private Set<Dep> dep;

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getRoleName() {
		return roleName;
	}

	public void setRoleName(String roleName) {
		this.roleName = roleName;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public int getNo() {
		return No;
	}

	public void setNo(int no) {
		No = no;
	}

	public int getRoleLX() {
		return roleLX;
	}

	public void setRoleLX(int roleLX) {
		this.roleLX = roleLX;
	}

	public Set<Dep> getDep() {
		return dep;
	}

	public void setDep(Set<Dep> dep) {
		this.dep = dep;
	}
	
	public Role(String id, String roleName, String description, int no,
			int roleLX, Set<Dep> dep) {
		super();
		this.id = id;
		this.roleName = roleName;
		this.description = description;
		No = no;
		this.roleLX = roleLX;
		this.dep = dep;
	}

	public Role() {

	}	
	
}